home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / DATAUTIL / DBASEUT1.LZH / COLORSET.PRG < prev    next >
Text File  |  1986-10-29  |  7KB  |  234 lines

  1. *                    * * * * * * * * * * * * * * * * * * *
  2. *                    *     Set dBASE III Plus Colors     *
  3. *                    *                                   *
  4. *                    *  (c)Copyright 1986, by MagicSoft  *
  5. *                    *                                   *
  6. *                    *        All Rights Reserved        *
  7. *                    * * * * * * * * * * * * * * * * * * *
  8. *
  9. * Initialize
  10.   set talk off
  11.   set color to
  12.   set format to
  13.   clear
  14.   clear gets
  15.   store .f. to error
  16. * Define Variables
  17.   private fg, bg, bd, df, db
  18.   public color
  19.   store '' to color
  20.   store space(14) to fg
  21.   store space(7) to bg
  22.   store space(14) to bd
  23.   store space(14) to df
  24.   store space(7) to db
  25. * Draw Screen
  26.   set color to w+
  27.   @  0,  0  TO 24, 79    DOUBLE
  28.   @ 17,  2  TO 23, 77  
  29.   @  1,  2  TO  3, 77  
  30.   @  4,  2  TO 16, 38  
  31.   @  4, 40  TO 16, 77  
  32.   @  2,  4  SAY "dBASE III Plus Color Selection"
  33.   @  2, 40  SAY "(pd)Public Domain 1986, by MagicSoft"
  34.   @  5,  9  SAY "Foregrounds & Boarder"
  35.   @  6,  3  SAY "___________________________________" 
  36.   set color to +
  37.   @  8, 14  SAY "Light Black"
  38.   set color to b+
  39.   @  9, 14  SAY "Light Blue"
  40.   set color to g+
  41.   @ 10, 14  SAY "Light Green"
  42.   set color to bg+
  43.   @ 11, 14  SAY "Light Cyan"
  44.   set color to r+
  45.   @ 12, 14  SAY "Light Red"
  46.   set color to br+
  47.   @ 13, 14  SAY "Light Magenta"
  48.   set color to gr+
  49.   @ 14, 14  SAY "Yellow"
  50.   set color to w+
  51.   @ 15, 14  SAY "Light White"
  52.   @  5, 54  SAY "Backgrounds"
  53.   @  6, 41  SAY "____________________________________"
  54.   set color to w
  55.   @  8, 56  SAY "Black"
  56.   set color to b
  57.   @  9, 56  SAY "Blue"
  58.   set color to g
  59.   @ 10, 56  SAY "Green"
  60.   set color to bg
  61.   @ 11, 56  SAY "Cyan"
  62.   set color to r
  63.   @ 12, 56  SAY "Red"
  64.   set color to br
  65.   @ 13, 56  SAY "Magenta"
  66.   set color to gr
  67.   @ 14, 56  SAY "Brown"
  68.   set color to w
  69.   @ 15, 56  SAY "White"
  70.   set color to w+
  71.   @ 18, 22  SAY "Screen Foreground:"
  72.   @ 19, 22  SAY "Screen Background:"
  73.   @ 20, 22  SAY "Screen Boarder:"
  74.   @ 21, 22  SAY "Data Foreground:"
  75.   @ 22, 22  SAY "Data Background:"
  76. * Accept Data
  77.   @ 18, 41  GET  FG
  78.   @ 19, 41  GET  BG
  79.   @ 20, 41  GET  BD
  80.   @ 21, 41  GET  DF
  81.   @ 22, 41  GET  DB
  82.   read
  83. * Process Data
  84.   store lower(fg) to fg
  85.   store lower(bg) to bg
  86.   store lower(bd) to bd
  87.   store lower(df) to df
  88.   store lower(db) to db
  89.   do case
  90.     case at('black',fg) > 0
  91.       note no op
  92.     case at('blue',fg) > 0
  93.       store 'B' to color
  94.     case at('green',fg) > 0
  95.       store 'G' to color
  96.     case at('cyan',fg) > 0
  97.       store 'BG' to color
  98.     case at('red',fg) > 0
  99.       store 'R' to color
  100.     case at('magenta',fg) > 0
  101.       store 'BR' to color
  102.     case at('yellow',fg) > 0
  103.       store 'GR' to color
  104.     case at('brown',fg) > 0
  105.       store 'GR' to color
  106.     case at('white',fg) > 0
  107.       store 'BGR' to color
  108.     otherwise
  109.       store .t. to error
  110.   endcase
  111.   if at('bright',fg)>0 .or. at('light',fg)>0 .or. at('bold',fg)>0 .or. at('yellow',fg)>0
  112.     store color+'+' to color
  113.   endif
  114.   store color+'/' to color
  115.   do case
  116.     case at('black',bg) > 0
  117.       note no op
  118.     case at('blue',bg) > 0
  119.       store color+'B' to color
  120.     case at('green',bg) > 0
  121.       store color+'G' to color
  122.     case at('cyan',bg) > 0
  123.       store color+'BG' to color
  124.     case at('red',bg) > 0
  125.       store color+'R' to color
  126.     case at('magenta',bg) > 0
  127.       store color+'BR' to color
  128.     case at('yellow',bg) > 0
  129.       store color+'GR' to color
  130.     case at('brown',bg) > 0
  131.       store color+'GR' to color
  132.     case at('white',bg) > 0
  133.       store color+'BGR' to color
  134.     otherwise
  135.       store .t. to error
  136.   endcase
  137.   store color+',' to color
  138.   do case
  139.     case at('black',df) > 0
  140.       note no op
  141.     case at('blue',df) > 0
  142.       store color+'B' to color
  143.     case at('green',df) > 0
  144.       store color+'G' to color
  145.     case at('cyan',df) > 0
  146.       store color+'BG' to color
  147.     case at('red',df) > 0
  148.       store color+'R' to color
  149.     case at('magenta',df) > 0
  150.       store color+'BR' to color
  151.     case at('yellow',df) > 0
  152.       store color+'GR' to color
  153.     case at('brown',df) > 0
  154.       store color+'GR' to color
  155.     case at('white',df) > 0
  156.       store color+'BGR' to color
  157.     otherwise
  158.       store .t. to error
  159.   endcase
  160.   if at('bright',df)>0 .or. at('light',df)>0 .or. at('bold',df)>0 .or. at('yellow',df)>0
  161.     store color+'+' to color
  162.   endif
  163.   store color+'/' to color
  164.   do case
  165.     case at('black',db) > 0
  166.       note no op
  167.     case at('blue',db) > 0
  168.       store color+'B' to color
  169.     case at('green',db) > 0
  170.       store color+'G' to color
  171.     case at('cyan',db) > 0
  172.       store color+'BG' to color
  173.     case at('red',db) > 0
  174.       store color+'R' to color
  175.     case at('magenta',db) > 0
  176.       store color+'BR' to color
  177.     case at('yellow',db) > 0
  178.       store color+'GR' to color
  179.     case at('brown',db) > 0
  180.       store color+'GR' to color
  181.     case at('white',db) > 0
  182.       store color+'BGR' to color
  183.     otherwise
  184.       store .t. to error
  185.   endcase
  186.   store color+',' to color
  187.   do case
  188.     case at('black',bd) > 0
  189.       note no op
  190.     case at('blue',bd) > 0
  191.       store color+'B' to color
  192.     case at('green',bd) > 0
  193.       store color+'G' to color
  194.     case at('cyan',bd) > 0
  195.       store color+'BG' to color
  196.     case at('red',bd) > 0
  197.       store color+'R' to color
  198.     case at('magenta',bd) > 0
  199.       store color+'BR' to color
  200.     case at('yellow',bd) > 0
  201.       store color+'GR' to color
  202.     case at('brown',bd) > 0
  203.       store color+'GR' to color
  204.     case at('white',bd) > 0
  205.       store color+'BGR' to color
  206.     otherwise
  207.       store .t. to error
  208.   endcase
  209.   if at('bright',bd)>0 .or. at('light',bd)>0 .or. at('bold',bd)>0 .or. at('yellow',bd)>0
  210.     store color+'+' to color
  211.   endif
  212. * End
  213.   if error
  214.     clear
  215.     ?'An error has been detected.'
  216.     ?'Please be sure that the colors'
  217.     ?'you specified are available.'
  218.     ?
  219.     wait
  220.     do color
  221.     return
  222.     * * * * * * * * * * * * * * * * * * * * * * * * * *
  223.     * Or comment out the above lines after 'if error' *
  224.     * to use the following line as a default.  This   *
  225.     * would allow pressing Escape to yeild your       *
  226.     * favorite color combination.                     *
  227.     * * * * * * * * * * * * * * * * * * * * * * * * * *
  228.     store 'W+/B,GR+/B,B' to color
  229.   endif
  230.   set color to &color
  231.   set talk on
  232.   clear
  233.   return
  234.